class Solution {
public:
    bool isUnique(string astr) {
        int bitmap = 0;
        if (astr.size() > 26) return false;
        for (auto ch : astr) {
            int i = ch - 'a';
            if ((bitmap >> i) & 1 == 1) return false;
            bitmap |= 1 << i;
        }
        return true;
    }
};